export function HttpGet(url){
    var result = fetch(url);
    return result
}

export function HttpPost(url,data){
    var result = fetch(url,{
        headers:{
            "Accept":"application/json,text/plain, */*",
            "Content-Type":"application/x-www-form-urlencoded"
        },
        body:params(data)
    })
    return result;
}

function params(data){
    let result="",item;
    for(item in data){
        result+=`&${item}=${encodeURIComponent(data[item])}`
    }
    if(result){
        result = result.slice(1)
    }
    return result;
}